/*
 This file 'zdwxyListApp' is part of Firebird Integrated Solution 1.0

 Copyright (c) 2020 Lincong

 Contact:  
        Email: lincong1987@gmail.com

        QQ: 159257119
 
 See Usage at http://www.jplatformx.com/firebird

 Create date: 2020-06-19 17:56
 */

define(function (require, exports, module) {
	require("Firebird.App");
	require("Firebird.Controller");
	require("Format");
	require("FileAttachment");


	var pager2 = require("_fbGrid_/pager2/pager2");
	var tmpl = require("tmpl");


	var controller = Firebird.create("Firebird.Controller", {
		controller: "{contextPath}/mqentrate"
	});


	Firebird.define("zdwxy.OnlineApp", {
		extend: "Firebird.SearchApp",
		controller: controller,
		setContext: function () {
			var app = this;
			var context = this.context;
			var render = require("./zdwxy-online.tmpl");


			// $.ajax({
			// 	url: GLOBAL_CONFIG.contextPath + "/mqentrate/searchMqChk",
			// 	data: {},
			// 	success: function (json) {

			var json = {
				success: true,
				data: [
					{
						id: 1,
						name: "勘探",
						value1: 200,
						value2: 198,
						value3: 2
					}
				]
			};

			$("#J_list")
				.html(render({data: json.data}))
				.on("click", ".show-sub-table-btn", function (e) {
					var $subTable = $(e.target).parent().next();
					if ($subTable.css("display", "none")) {
						$subTable.css("display", "");
					} else {
						$subTable.css("display", "none");
					}
				});


			// 	}
			// });


		}
	});


});